home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / mip_100.zip / FOSSIL.PAS next >
Pascal/Delphi Source File  |  1991-01-19  |  2KB  |  83 lines

  1. Unit Fossil;
  2.  
  3. Interface
  4.  
  5. Uses
  6.   Dos;
  7. Var
  8.   Msr : Registers;
  9.  
  10. Function F_Intr_14(Ax_Input : Word) : Word;
  11. Procedure P_Intr_14(Ah, Al : Byte);
  12. Function SignOn : Boolean;
  13. Procedure SignOff;
  14. Procedure RaiseDtr;
  15. Procedure LowerDtr;
  16. Procedure SetParameters(BaudRate : String);
  17. Function Status : Integer;
  18. Function CD : Boolean;
  19. Procedure ClearReceiveBuffer;
  20.  
  21. Implementation
  22.  
  23. {========================================================================}
  24. Function F_Intr_14(Ax_Input : Word) : Word;
  25.   Begin
  26.     With Msr Do
  27.     Begin
  28.       Ax := Ax_Input; Dx := 0; Intr($14,Msr); F_Intr_14 := Ax;
  29.     End;
  30.   End;
  31. {========================================================================}
  32. Procedure P_Intr_14(Ah, Al : Byte);
  33.   Begin
  34.     Msr.Ah := Ah; Msr.Al := Al; Msr.Dx := 0; Intr($14,Msr);
  35.   End;
  36. {========================================================================}
  37. Function SignOn : Boolean;
  38.   Begin
  39.     If F_Intr_14($0400) = $1954 Then SignOn := True Else SignOn := False;
  40.   End;
  41. {========================================================================}
  42. Procedure SignOff;
  43.   Begin
  44.     P_Intr_14($05,$00);
  45.   End;
  46. {========================================================================}
  47. Procedure RaiseDtr;
  48.   Begin
  49.     P_Intr_14($06,$01);
  50.   End;
  51. {========================================================================}
  52. Procedure LowerDtr;
  53.   Begin
  54.     P_Intr_14($06,$00);
  55.   End;
  56. {========================================================================}
  57. Procedure SetParameters(BaudRate : String);
  58.   Begin
  59.     If BaudRate = '300' Then P_Intr_14($00,$43);
  60.     If BaudRate = '1200' Then P_Intr_14($00,$83);
  61.     If BaudRate = '2400' Then P_Intr_14($00,$A3);
  62.     If BaudRate = '9600' Then P_Intr_14($00,$E3);
  63.   End;
  64. {========================================================================}
  65. Function Status : Integer;
  66.   Begin
  67.     Status := F_Intr_14($0300);
  68.   End;
  69. {========================================================================}
  70. Function CD : Boolean;
  71.   Begin
  72.     If (F_Intr_14($0300) And $0080) = $0080 Then CD := True Else CD := False;
  73.   End;
  74. {========================================================================}
  75. Procedure ClearReceiveBuffer;
  76.   Begin
  77.     P_Intr_14($0A,$00);
  78.   End;
  79. {========================================================================}
  80. Begin
  81. End.
  82. {========================================================================}
  83.